package com.qf.common.vo;

import lombok.Getter;

import javax.validation.ConstraintViolationException;

/**
 * @author 86155
 * @ClassName: com.qf.common.vo.ResponseCode
 * @Description: 该类的功能描述
 * @date: 2021/10/8 17:38
 */
@Getter
public enum ResponseCode {
    /**
     * 通用状态码
     */
    SUCCESS(200, "success"),
    ERROR(404, "error"),

    /**
     * 删除错误状态码
     */
    DEL_ERROR(40101, "del_error"),
    /**
     * 添加错误状态码
     */
    INSERT_ERROR(400102, "insert_error"),
    /**
     * 更新错误状态码
     */
    UPDATE_ERROR(400103, "update_error"),

    /*系统相关*/
    STORE_AN_ERROR(40301, "auth_store_error"),
    STORE_MSG_ERROR(40300, "store_setting_error"),
    SYS_ERROR(40400, "sys error"),

    /**
     * 系统相关的、业务异常、订单状态
     */
    ACCOUNT_IS_EXIST(40100, "username  or  phone  is exist"),


    /**
     * controller 数据校验异常
     */
    CONSTRAINT_EXCEPTION(40200, "请求参数校验失败"),
    METHOD_ARGUMENT(40201, "请求对象校验失败"),
    BIND_HANDLER(40202, "请求路径中请求对象校验失败"),
    UNKNOWN_EXCEPTION(40203, "系统异常"),

    UNKNOWN_ACCOUNT(40204, "账户或者密码错误"),

    ;


    private int status;
    private String msg;

    ResponseCode(int status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    ResponseCode(int status) {
        this.status = status;
    }
}
